package com.smedi.ismedi.authoritymanagement.api.feign;

import com.smedi.ismedi.authority.starter.response.AuthorityAccessResponse;
import com.smedi.ismedi.authoritymanagement.api.dto.request.LoginRequest;

import com.smedi.ismedi.authoritymanagement.api.dto.response.NodeInfoResponse;
import com.smedi.ismedi.web.starter.common.ResponseData;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

@Api(tags = {"用户登录管理"})
@FeignClient(name = "ismedi-authority-management")
@RequestMapping(value = "/api/v1/account/login")
public interface RemoteClientLoginFeignApi {
    /**
     * pc端用户登录
     *
     * @param loginRequest
     * @return
     */
    @ApiOperation(httpMethod = "POST", value = "pc端用户登录")
    @PostMapping(value = "/client/pc")
    @Deprecated
    ResponseData<AuthorityAccessResponse> postLoginPc(@Validated @RequestBody LoginRequest loginRequest);

    /**
     * mobile端用户登录
     *
     * @param loginRequest
     * @return
     */
    @ApiOperation(httpMethod = "POST", value = "mobile端用户登录")
    @PostMapping(value = "/client/mobile")
    @Deprecated
    ResponseData<AuthorityAccessResponse> postLoginMobile(@Validated @RequestBody LoginRequest loginRequest);

    @ApiOperation(httpMethod = "PUT", value = "客户端登出")
    @PutMapping(value = "/client/logout")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "token", value = "令牌", dataType = "String", dataTypeClass = String.class),
    })
    ResponseData<Boolean> putLogout(@RequestParam("token") String token);

    /**
     * pc端用户快速登录
     *
     * @param loginRequest
     * @return
     */
    @ApiOperation(httpMethod = "POST", value = "pc端用户快速登录")
    @PostMapping(value = "/client/pc/fast")
    ResponseData<AuthorityAccessResponse> postLoginPcFast(@Validated @RequestBody LoginRequest loginRequest);

    /**
     * mobile端用户快速登录
     *
     * @param loginRequest
     * @return
     */
    @ApiOperation(httpMethod = "POST", value = "mobile端用户快速登录")
    @PostMapping(value = "/client/mobile/fast")
    ResponseData<AuthorityAccessResponse> postLoginMobileFast(@Validated @RequestBody LoginRequest loginRequest);

    /**
     * 获取初始的用户三级组织切换信息
     *
     * @return NodeInfoResponse
     */
    @ApiOperation(httpMethod = "GET", value = "获取初始的用户三级组织切换信息")
    @GetMapping(value = "/getInitScopeTopPermissionInfo")
    ResponseData<NodeInfoResponse> getInitScopeTopPermissionInfo(@RequestParam("device") String device);

    /**
     * 获取当前的用户三级组织切换信息
     *
     * @return NodeInfoResponse
     */
    @ApiOperation(httpMethod = "GET", value = "获取当前的用户三级组织切换信息")
    @GetMapping(value = "/getCurrentScopeTopPermissionInfo")
    ResponseData<NodeInfoResponse> getCurrentScopeTopPermissionInfo();
}
